#include <iostream>
using namespace std;
#include <vector>
#include <map>
#include <algorithm>

#include <iostream>
using namespace std;
#include <vector>
#include <map>
#include <algorithm>

class Solution {
public:

    class cmp
    {
    public:
        bool operator()(const pair<string, int>& x, const pair<string, int>& y)
        {
            return (x.second < y.second) || (x.second == y.second && x.first > y.first);
        }
    };

    vector<pair<string, int>> topKFrequent(vector<string>& words) {
        map<string, int> hash;
        for (auto& str : words) hash[str]++;

        vector<pair<string, int>> v(hash.begin(), hash.end());
        sort(v.begin(), v.end(), cmp());
        reverse(v.begin(), v.end());


        return v;
    }
};

int main()
{
    vector<string> words;
    string s;
    getline(cin, s);

    for (int i = 0; i < s.size(); i++) if (s[i] >= 'A' && s[i] <= 'Z') s[i] += 32;
    for (int i = 0, left = 0; i < s.size(); i++)
    {
        if (s[i] == ' ' || s[i] == '.')
        {
            words.push_back(string(s.begin() + left, s.begin() + i));
            left = i + 1;
        }
    }

    vector<pair<string, int>> ret = Solution().topKFrequent(words);
    for (int i = 0; i < ret.size(); i++)
    {
        cout << ret[i].first << ":" << ret[i].second << endl;
    }

    return 0;
}

class Solution {
public:

    class cmp
    {
    public:
        bool operator()(const pair<string, int>& x, const pair<string, int>& y)
        {
            return (x.second < y.second) || (x.second == y.second && x.first > y.first);
        }
    };

    vector<string> topKFrequent(vector<string>& words, int k) {
        map<string, int> hash;
        for (auto& str : words) hash[str]++;

        vector<pair<string, int>> v(hash.begin(), hash.end());
        sort(v.begin(), v.end(), cmp());
        reverse(v.begin(), v.end());

        vector<string> ret;
        for (int i = 0; i < k; i++) ret.push_back(v[i].first);

        return ret;
    }
};